package com.tc.dispatch.csservice.util;

import java.util.Comparator;
import com.tc.dispatch.csservice.model.CombinedOrderSumMainSimilay;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2008</p>
 * <p>Company: zju</p>
 * @author jakcyjia
 * @version 1.0
 */

public class OrderSimComp implements Comparator {
  public OrderSimComp() {
  }
  public int compare(Object o1, Object o2) {
    try { CombinedOrderSumMainSimilay osm1=(CombinedOrderSumMainSimilay)o1;
    CombinedOrderSumMainSimilay osm2=(CombinedOrderSumMainSimilay)o2;
       if (Math.abs( osm1.getSim().floatValue())>Math.abs(osm2.getSim().floatValue())) {
	 return -1;
       }
       else {
	 return 1;
       }
     }
     catch (Exception ex) {
       System.out.println("Exception is found in compare:"+ex.getMessage());
       return -1;
     }

  }
  public boolean equals(Object obj) {
    /**@todo Implement this java.util.Comparator method*/
    throw new java.lang.UnsupportedOperationException("Method equals() not yet implemented.");
  }

}